<template>
	<view >
		<uni-list>
			<uni-list-item showArrow title="修改密码" clickable @click="goPage('modifyPassword')"/>
		</uni-list>
		<button type="warn" @click="logout()">退出登录</button>
		
		<uni-popup ref="confirmLogout" type="dialog">
		    <uni-popup-dialog type="info" cancelText="关闭" confirmText="确认" content="您确认退出登录吗？" @confirm="doLogin()"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	import {removeUid,removeUsername} from '@/utils/userInfo'
	export default {
		data(){
			return {
				lists: [
					{
						name: "修改密码",
						url: "badge"
					},
				]
			}
		},
		methods: {
			goPage(path) {
				console.log(path)
				const url = './' + path
				uni.navigateTo({
					url: url
				})
			},
			logout(){
				this.$refs.confirmLogout.open()
			},
			/**
			 * 退出登录
			 */
			doLogin(){
				removeUid()
				removeUsername()
				uni.navigateTo({
					url: "../login"
				})
			}
		}
	}
</script>

<style>

	.text {
		margin: 15rpx 10rpx;
		padding: 0 20rpx;
		background-color: #ebebeb;
		height: 70rpx;
		line-height: 70rpx;
		text-align: center;
		color: #777;
		font-size: 26rpx;
	}

	.flex-pc {
		display: flex;
		justify-content: center;
	}
</style>